import 'package:flutter/material.dart';

Color primaryColor = const Color(0xffdb0a17);
Color secondColor = const Color(0xffec6622);
Color primaryLite = const Color.fromARGB(255, 220, 237, 252);
Color warningColor = const Color(0xffE98E65);
Color dangerColor = const Color(0xffff7071);

ThemeData get defaultThemeData => ThemeData(
      platform: TargetPlatform.iOS,
      primaryColor: primaryColor,
      secondaryHeaderColor: secondColor,
      primaryColorLight: primaryLite,
      scaffoldBackgroundColor: primaryLite,
      fontFamily: 'SourceHanSansCN',
      textTheme: TextTheme(
        bodyLarge: TextStyle(fontSize: 24.0, color: secondColor),
        bodyMedium: TextStyle(fontSize: 18.0, color: secondColor),
        bodySmall: TextStyle(fontSize: 12.0, color: secondColor),
        titleLarge: TextStyle(
          fontSize: 26.0,
          color: primaryColor,
          fontWeight: FontWeight.bold,
        ),
        titleMedium: TextStyle(
          fontSize: 20.0,
          color: primaryColor,
          fontWeight: FontWeight.bold,
        ),
        titleSmall: TextStyle(
          fontSize: 14.0,
          color: primaryColor,
          fontWeight: FontWeight.bold,
        ),
        labelLarge: TextStyle(fontSize: 25.0, color: secondColor),
        labelMedium: TextStyle(fontSize: 21.0, color: secondColor),
        labelSmall: TextStyle(fontSize: 13.0, color: secondColor),
      ),
      dividerColor: secondColor,
      dividerTheme: DividerThemeData(
        color: secondColor,
        space: 1,
        thickness: 1,
      ),
      drawerTheme: DrawerThemeData(
        elevation: 3,
        backgroundColor: primaryColor,
      ),
      listTileTheme: ListTileThemeData(
        // tileColor: secondColor,
        selectedTileColor: primaryColor,
        iconColor: secondColor,
        textColor: secondColor,
        selectedColor: primaryColor,
        contentPadding: EdgeInsets.zero,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(5),
        ),
        visualDensity: const VisualDensity(
          vertical: VisualDensity.minimumDensity,
        ),
      ),
      iconTheme: IconThemeData(
        color: secondColor,
      ),
      textSelectionTheme: TextSelectionThemeData(
        cursorColor: primaryColor,
        selectionColor: primaryColor.withOpacity(0.5),
        selectionHandleColor: primaryColor,
      ),
      appBarTheme: AppBarTheme(
        centerTitle: true,
        backgroundColor: primaryColor,
        elevation: 0,
        iconTheme: const IconThemeData(color: Colors.white, size: 18),
        titleTextStyle: const TextStyle(fontSize: 16, color: Colors.white),
        toolbarTextStyle: const TextStyle(fontSize: 16, color: Colors.white),
        actionsIconTheme: const IconThemeData(color: Colors.white, size: 18),
      ),
      bottomNavigationBarTheme: BottomNavigationBarThemeData(
        selectedItemColor: primaryColor,
        unselectedItemColor: Colors.black54,
        backgroundColor: secondColor.withOpacity(0.05),
        elevation: 0,
        type: BottomNavigationBarType.fixed,
        selectedLabelStyle: const TextStyle(
          fontSize: 16,
          fontWeight: FontWeight.bold,
        ),
        unselectedLabelStyle: const TextStyle(
          fontSize: 16,
          fontWeight: FontWeight.bold,
        ),
      ),
      iconButtonTheme: IconButtonThemeData(
        style: ButtonStyle(
          overlayColor: MaterialStateProperty.all(Colors.transparent),
          foregroundColor: MaterialStateProperty.resolveWith(
            (states) {
              if (states.contains(MaterialState.pressed)) {
                return secondColor.withOpacity(0.8);
              }
              return secondColor;
            },
          ),
        ),
      ),
      inputDecorationTheme: InputDecorationTheme(
        hintStyle: TextStyle(
            color: secondColor, fontSize: 16, fontWeight: FontWeight.w200),
        labelStyle: TextStyle(color: primaryColor),
        enabledBorder: UnderlineInputBorder(
          borderSide: BorderSide(color: secondColor),
        ),
        focusedBorder: UnderlineInputBorder(
          borderSide: BorderSide(color: secondColor),
        ),
        border: UnderlineInputBorder(
          borderSide: BorderSide(color: secondColor),
        ),
        prefixIconColor: secondColor,
        suffixIconColor: secondColor,
      ),
      elevatedButtonTheme: ElevatedButtonThemeData(
        style: ButtonStyle(
          elevation: MaterialStateProperty.all<double>(5),
          backgroundColor: MaterialStateProperty.resolveWith<Color>(
            (Set<MaterialState> states) {
              if (states.contains(MaterialState.disabled)) {
                return primaryColor.withOpacity(0.5);
              }
              return primaryColor;
            },
          ),
          foregroundColor: MaterialStateProperty.resolveWith<Color>(
            (Set<MaterialState> states) {
              if (states.contains(MaterialState.disabled)) {
                return Colors.white.withOpacity(0.5);
              }
              return Colors.white;
            },
          ),
          overlayColor: MaterialStateProperty.all(Colors.transparent),
          shape: MaterialStateProperty.all(
            RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(5),
            ),
          ),
          textStyle: MaterialStateProperty.all(
            const TextStyle(
              fontSize: 20,
            ),
          ),
        ),
      ),
      textButtonTheme: TextButtonThemeData(
        style: ButtonStyle(
          overlayColor: MaterialStateProperty.all(Colors.transparent),
          foregroundColor: MaterialStateProperty.resolveWith(
            (states) {
              if (states.contains(MaterialState.pressed)) {
                return primaryColor.withOpacity(0.8);
              }
              return primaryColor;
            },
          ),
        ),
      ),
      radioTheme: RadioThemeData(
        fillColor: MaterialStateProperty.all(primaryColor),
      ),
      colorScheme: ColorScheme.fromSwatch()
          .copyWith(
            secondary: warningColor,
          )
          .copyWith(
            error: dangerColor,
          ),
      snackBarTheme: SnackBarThemeData(
        backgroundColor: primaryColor,
        contentTextStyle: const TextStyle(color: Colors.white),
        actionTextColor: Colors.white,
      ),
    );
